package cn.tedu.spring.eg4;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class ShopController {
    private String shop;

    public ShopController() {
        System.out.println("实例化阶段");
    }

    @Value("购物")
    public void setShop(String shop) {
        this.shop = shop;
        System.out.println("属性赋值阶段");
    }

    @PostConstruct
    public void shopStart(){
        System.out.println("初始化阶段");
    }

    @PreDestroy
    public void shopEnd(){
        System.out.println("销毁阶段");
    }
}
